package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.check.dutyperson;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class DutyPersonService extends BaseService {

	private static final Logger logger = LoggerFactory.getLogger(DutyPersonService.class);


	/**
	 * 值班人员列表
	 * @param
	 * @return
	 */
	public RespEntity dutyPersonListPage(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return restJava(jsonParam,"checkJava","dutyPersonListPage","dutyPerson");
	}

	/**
	 * 值班人员详情
	 * @param
	 * @return
	 */
	public RespEntity dutyPersonDetail(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return restJava(jsonParam,"checkJava","dutyPersonDetail","dutyPerson");
	}

	/**
	 * 值班人员新增
	 * @param
	 * @return
	 */
	public RespEntity dutyPersonAdd(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());

		return restJava(jsonParam,"checkJava","dutyPersonAdd","dutyPerson");
	}

	/**
	 * 值班人员修改
	 * @param
	 * @return
	 */
	public RespEntity dutyPersonUpdate(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());

		return restJava(jsonParam,"checkJava","dutyPersonUpdate","dutyPerson");
	}

	/**
	 * 值班人员删除
	 * @param
	 * @return
	 */
	public RespEntity dutyPersonDelete(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());

		return restJava(jsonParam,"checkJava","dutyPersonDelete","dutyPerson");
	}

	/**
	 * 值班人员不分页列表
	 * @param
	 * @return
	 */
	public RespEntity dutyPersonListNoPage(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return restJava(jsonParam,"checkJava","dutyPersonListNoPage","dutyPerson");
	}

	/**
	 * 判断是否需要值班，就是是否为值班人员，是否显示值班按钮，以及显示什么按钮
	 * @param
	 * @return
	 */
	public RespEntity isNeedDuty(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return restJava(jsonParam,"checkJava","isNeedDuty","dutyPerson");
	}

	/**
	 * 开始值班
	 * @param
	 * @return
	 */
	public RespEntity startDuty(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return restJava(jsonParam,"checkJava","startDuty","dutyPerson");
	}

	/**
	 * 结束值班
	 * @param
	 * @return
	 */
	public RespEntity endDuty(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return restJava(jsonParam,"checkJava","endDuty","dutyPerson");
	}

	/**
	 * 值班记录
	 * @param
	 * @return
	 */
	public RespEntity getDutyRecord(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return restJava(jsonParam,"checkJava","getDutyRecord","dutyPerson");
	}

	/**
	 * 现在正在值班人员
	 * @param
	 * @return
	 */
	public RespEntity nowDutyPerson(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return restJava(jsonParam,"checkJava","nowDutyPerson","dutyPerson");
	}

}
